﻿@model IList<CardInChina.Web.Mvc.Models.HotSearchItem>
<div class=" search">
    <div class="hot_search">
        <p>
            热门搜索 >>
             @*<a href="">完美</a> <a href=""><span>搜狐</span></a> <a href=""><span>
                盛大</span></a> <a href=""><span>魔兽世界</span></a> <a href=""><span>盛大</span></a>
            <a href=""><span>Q币卡</span></a> <a href=""><span>人人</span></a> <a href=""><span>5137充值卡</span></a>
            <a href=""><span>网易</span></a> <a href=""><span>金山</span></a>*@

            @if (Model != null)
            {
                foreach (CardInChina.Web.Mvc.Models.HotSearchItem hsi in Model)
                {
                    @Html.ActionLink(hsi.Display, "Index", "CardDetail", new { cardKey = hsi.ItemID /*TODO: change to card_key! */ }, new { title = hsi.Title });
                    <span>&nbsp;</span>
                }
            }
                    
        </p>
    </div>
    <script type="text/javascript">
        $(function () {

            var fnSearch = function () {

                var keyword = $.trim($("#CrawlUrl").val());
                if (!keyword) {
                    alert("请输入搜索关键字！");
                    $("#CrawlUrl").focus();
                    return false;
                }

                var target = "/search/" + encodeURI(keyword);
                window.location.href = target;
                return false;
            };

            $("#CrawlBtn").click(fnSearch);
            $("#CrawlUrl").bind("keydown", function (e) {
                if (e.which == 13)
                    fnSearch();
            });
        })
    </script>
    <div class="fast_search">
        <div class="fast_search_bg ui-icons fast_search_position">
                <input class="fast_wz_" id="CrawlUrl" type="text" x-webkit-speech="" lang="zh-CN" x-webkit-grammar="builtin:translate" />
                <a href="javascript:void(0);" class="linkbutton ui-icons linkbutton_position" id="CrawlBtn"></a>
        </div>
    </div>
</div>
